		maclist	off
DIRASC		.MACRO
DSC0		.VAR	0
DSC0		.VAR	1
		.ENDM

		DIRASC
		NOP
GETKY0		.EQU	*
		NOP
		maclist	on

;		CONCAT MACROS 
label:
concat		.macro	arg
mac_value:	.var	mac_value+1
arg|<mac_value>	.equ	31
		endm
mac_value	.var	0
		concat	label


;		STRING COMPARISONS

cmp_string:	.macro	arg1
		ifnma	1
		exit	"cmp_string Needs an Argument"
		macexit
		endif
		ifsame	"January",arg1
Month		byte	1
		macexit
		endif
		ifsame	"February",arg1
Month		byte	2
		macexit
		endif
		ifsame	"March",arg1
Month		byte	3
		macexit
		endif
		ifsame	"April",arg1
Month		byte	4
		macexit
		endif
		ifsame	"May",arg1
Month		byte	5
		macexit
		endif
		ifsame	"June",arg1
Month		byte	6
		macexit
		endif
		exit	"argument error in macro string"
		endm
		cmp_string	"April"


;		ARGUMENT SUBSTITUTION IN AN OPERAND FIELD

Employee_Info1:	.macro	arg1,arg2,arg3
Name:		.db	arg1
Department:	.ascii	arg2
Date_hired:	.long	arg3
		.endm
		Employee_Info1	"John Doe",personal,101085

;		PASSING ARGUMENTS INTO LABEL FIELDS

Employee_Info2:	.macro	arg1,arg2,arg3
arg1:		.ds	30h
arg2:		.ds	10h
arg3:		.long
		.endm
		Employee_Info2	name,department,date_hired

;	SUBSTITUTING IN TO THE MNEMONIC FIELD
	
instruction:	.macro	arg,val
		arg
lab#:		.ds	val
		.macend
		instruction 	nop,7

;	REDEFINING THE MNEMONIC	

		.macfirst on

nop:		.macro	arg	
		.db	arg
		.endm
		nop	ffh
		.macfirst off

;	PASSING COMMAS INTO A MACRO
	
		macdelim	{
delim_ex1:	macro		arg1,arg2
		byte		ffh,arg1 arg2
		endm
		delim_ex1	{a4h},{,12h}

		macdelim	[
delim_ex2:	macro		arg1
		byte		ffh arg1
		endm
		delim_ex2	[,a4h]

		macdelim	(
delim_ex3:	macro		arg1
		byte		ffh arg1
		endm
		delim_ex3	(,a4h)

;		MACRO RECURSION

reserve:	.macro		arg1,arg2,arg3,arg4,arg5
count:		.var		arg1
		.ifz		count
		.ifclear
		.macexit
		.endif
count:		.var		count-1
		.byte		arg2,arg3,arg4,arg5
		reserve	count,arg2,arg3,arg4,arg5
		.macend
		reserve		10,ah,bh,ch,dh

		.end

